package com.norma.macaron.service.common.client.auth;

import com.norma.macaron.common.model.response.BaseResponse;
import com.norma.macaron.common.model.response.ResponseT;
import com.norma.macaron.service.common.domain.auth.request.LoginRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("macaron-oauth")
public interface AuthServiceClient {

    @PostMapping(value = "/v1.0/auth/login")
    ResponseT login(@RequestParam("userName") String userName, @RequestParam("password") String password);

    @PostMapping(value = "/v1.0/auth/wechat/login")
    ResponseT wechatLogin(@RequestParam("openId") String openId, @RequestParam("tempId") String tempId);

    @PostMapping(value = "/v1.0/auth/sms/login")
    ResponseT smsLogin(@RequestParam("phone") String phone, @RequestParam("smsCode") String smsCode);

    @PostMapping("/v1.0/auth/logout")
    BaseResponse logout(@RequestParam("token") String token);

    @PostMapping("/v1.0/auth/jwt")
    ResponseT userjwt(@RequestParam("uid") String uid);

    @GetMapping("/v1.0/auth/getCurrentUser")
    ResponseT getCurrentUser(@RequestParam("headerStr") String headerStr);
}
